package com.micrometa.km.ui.components.tree;

import java.io.File;

import javax.swing.Icon;
import javax.swing.filechooser.FileSystemView;
import javax.swing.tree.DefaultMutableTreeNode;

public class FileTreeNode extends DefaultMutableTreeNode {
	private static final long serialVersionUID = 1L;
	private File file;
	private Icon icon;

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
		this.icon = FileSystemView.getFileSystemView().getSystemIcon(file);
	}

	public Icon getIcon() {
		return icon;
	}

	public FileTreeNode() {
		super(null);
	}

	public FileTreeNode(Object userObject) {
		super(userObject, true);
	}

	public FileTreeNode(Object userObject, boolean allowsChildren) {
		super();
		parent = null;
		this.allowsChildren = allowsChildren;
		this.userObject = userObject;
	}
}
